import com.wmb.configs.AppConfig;
import com.wmb.control.LoginControl;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Dome1 {
    public static void main(String[] args) {
        //spring注解的配置测试
        test01();
    }

    public static void test01(){
        //启动ioc容器:new AnnotationConfigApplicationContext(配置类名.class);//配置类名.class
        AnnotationConfigApplicationContext annotationConfig = new AnnotationConfigApplicationContext(AppConfig.class);//配置类名.class
        //从容器中获取被管理的实例对象getBean("类名.class/注入类时起的名字")
        LoginControl bean = (LoginControl)annotationConfig.getBean("LoginControl.class");
        //调用类中的方法
        bean.loginControl();

    }
}
